import pyttsx3
engine = pyttsx3.init()
engine.say("滚滚长江东逝水,浪花淘尽英雄")
voices = engine.getProperty('voices')#更换发音人声音
for voice in voices:
    print(voice.id)
    engine.setProperty('voice',voice.id)
    engine.say('测试更改音色.')
rate = engine.getProperty('rate')
engine.setProperty('rate',rate+50)#语速控制
engine.say('Try to speak faster than me.')
engine.runAndWait()

